﻿using System;
using System.Windows.Forms;

namespace FROG
{
    static class Program
    {
        /// <summary>
        /// Point d'entrée principal de l'application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ApplicationExit += new EventHandler(Application_ApplicationExit);

            try
            {
                App.LoadConfig();
            }
            catch (Exception)
            {
                App.Config = new Config();
                App.SaveConfig();
            }
            
            Application.Run(new MainForm());
        }

        static void Application_ApplicationExit(object sender, EventArgs e)
        {
            App.SaveConfig();
        }

        public static FROG.Properties.Settings Settings
        {
            get { return FROG.Properties.Settings.Default; }
        }

    }
}